gdk_rectangle_union will happily add all the worlds pixels
to the union if the initial rectangle is initialized to all
zeros. Therefore, explicitly check for an empty rectangle
before calling it.
static void
union_with_clip (GtkWidget *widget,
- gpointer clip)
+ gpointer data)
{
+ GdkRectangle *clip = data;
GtkAllocation widget_clip;
if (!gtk_widget_is_visible (widget) ||
gtk_widget_get_clip (widget, &widget_clip);
- gdk_rectangle_union (&widget_clip, clip, clip);
+ if (clip->width == 0 || clip->height == 0)
+ *clip = widget_clip;
+ else
+ gdk_rectangle_union (&widget_clip, clip, clip);
}
void